<?js
var file = DbConnection.dbFolder();
var dirEntries = file.directoryEntries;
while (dirEntries.hasMoreElements()) {
	var dirEntry = dirEntries.getNext().QueryInterface(Components.interfaces.nsIFile);
	response.write(dirEntry.path + "<br>\n");
	//dirEntry.isDirectory()
}
?>

<hr>

<?js
var db = new DbConnection("test01");
if (!db.connection.tableExists("foo"))
	db.execNoResult("CREATE TABLE foo (a INTEGER PRIMARY KEY, b STRING)");
var query = db.prepare("SELECT * FROM foo WHERE a > ?1 AND b LIKE ?2 ORDER BY a DESC LIMIT 10");
var result = query.exec(1, "hello%");
for (var i = 0; i < result.length; i++) {
	var row = result[i];
	for (var j in row) {
		response.write(j + ": " + row[j] + "<br>\n");
	}
	response.write("<br>\n");
}
query.destroy();

//db.execNoResult("INSERT INTO foo (b) VALUES ('hello')");
query = db.prepare("INSERT INTO foo (b) VALUES (?1)");
query.exec("hello");
query.exec("helloa");
query.exec("hellob");
query.exec("helloc");
query.destroy();
?>